package com.ruoyi.depot.domain;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import com.ruoyi.common.annotation.Excel;
import lombok.Data;

/**
 * 盘点明细表
 * @TableName tb_stocktake_details
 */
@TableName(value ="tb_stocktake_details")
@Data
public class StocktakeDetails implements Serializable {
    /**
     * 盘点明细唯一标识
     */
    @TableId(value = "stocktake_detail_id")
    private String stocktakeDetailId;

    /**
     * 关联盘点表ID
     */
    @TableField(value = "stocktake_id")
    private String stocktakeId;

    /**
     * 产品SKU
     */
    @TableField(value = "sku")
    private String sku;

    /**
     * 产品名称
     */
    @TableField(exist = false)
    private String productName;

    /**
     * 产品id
     */
    @TableField(exist = false)
    private Long productId;

    /**
     * 仓库ID
     */
    @TableField(value = "warehouse_id")
    private Integer warehouseId;

    /**
     * 系统记录的库存数量
     */
    @TableField(value = "system_quantity")
    private BigDecimal systemQuantity;

    /**
     * 实际盘点数量
     */
    @TableField(value = "counted_quantity")
    private BigDecimal countedQuantity;

    /**
     * 差异量
     */
    @TableField(value = "difference")
    private BigDecimal difference;

    /**
     * 备注信息
     */
    @TableField(value = "notes")
    private String notes;

    /**
     * 记录创建时间
     */
    @TableField(value = "created_at")
    private Date createdAt;

    /**
     * 记录最后更新时间
     */
    @TableField(value = "updated_at")
    private Date updatedAt;


    /** 删除标记 */
    @TableLogic
    @TableField(value = "delete_status")
    private Integer deleteStatus;

    /** 是否已经盘点 */
    @TableField(value = "is_inventoried")
    private Boolean isInventoried;

    /** 库存版本号 */
    @TableField(value = "inventory_version")
    private Integer inventoryVersion;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        StocktakeDetails other = (StocktakeDetails) that;
        return (this.getStocktakeDetailId() == null ? other.getStocktakeDetailId() == null : this.getStocktakeDetailId().equals(other.getStocktakeDetailId()))
            && (this.getStocktakeId() == null ? other.getStocktakeId() == null : this.getStocktakeId().equals(other.getStocktakeId()))
            && (this.getSku() == null ? other.getSku() == null : this.getSku().equals(other.getSku()))
            && (this.getWarehouseId() == null ? other.getWarehouseId() == null : this.getWarehouseId().equals(other.getWarehouseId()))
            && (this.getSystemQuantity() == null ? other.getSystemQuantity() == null : this.getSystemQuantity().equals(other.getSystemQuantity()))
            && (this.getCountedQuantity() == null ? other.getCountedQuantity() == null : this.getCountedQuantity().equals(other.getCountedQuantity()))
            && (this.getDifference() == null ? other.getDifference() == null : this.getDifference().equals(other.getDifference()))
            && (this.getNotes() == null ? other.getNotes() == null : this.getNotes().equals(other.getNotes()))
            && (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()))
            && (this.getUpdatedAt() == null ? other.getUpdatedAt() == null : this.getUpdatedAt().equals(other.getUpdatedAt()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getStocktakeDetailId() == null) ? 0 : getStocktakeDetailId().hashCode());
        result = prime * result + ((getStocktakeId() == null) ? 0 : getStocktakeId().hashCode());
        result = prime * result + ((getSku() == null) ? 0 : getSku().hashCode());
        result = prime * result + ((getWarehouseId() == null) ? 0 : getWarehouseId().hashCode());
        result = prime * result + ((getSystemQuantity() == null) ? 0 : getSystemQuantity().hashCode());
        result = prime * result + ((getCountedQuantity() == null) ? 0 : getCountedQuantity().hashCode());
        result = prime * result + ((getDifference() == null) ? 0 : getDifference().hashCode());
        result = prime * result + ((getNotes() == null) ? 0 : getNotes().hashCode());
        result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
        result = prime * result + ((getUpdatedAt() == null) ? 0 : getUpdatedAt().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", stocktakeDetailId=").append(stocktakeDetailId);
        sb.append(", stocktakeId=").append(stocktakeId);
        sb.append(", sku=").append(sku);
        sb.append(", warehouseId=").append(warehouseId);
        sb.append(", systemQuantity=").append(systemQuantity);
        sb.append(", countedQuantity=").append(countedQuantity);
        sb.append(", difference=").append(difference);
        sb.append(", notes=").append(notes);
        sb.append(", createdAt=").append(createdAt);
        sb.append(", updatedAt=").append(updatedAt);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}